package com.xww.common.exception;

public class CommonException extends RuntimeException{

    private static final String systemName = "CLOUD";

    private String errCode;

    private String errMsg;

    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = systemName + errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    public CommonException(String errCode, String errMsg){
        this.errCode = systemName + errCode;
        this.errMsg = errMsg;
    }

    public CommonException(String errMsg, Throwable e){
        super(errMsg);
        this.errMsg =errMsg;
    }

    public CommonException(CommonError commonError){
        this.errCode = systemName + commonError.getErrorCode();
        this.errMsg = commonError.getErrorMsg();
    }


}
